package tr.edu.metu.is.mega.client.service;

import java.util.List;

import tr.edu.metu.is.mega.common.dto.CourseDTO;
import tr.edu.metu.is.mega.common.dto.LectureNoteDTO;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

/**
 * GWT lecture note service.
 */
@RemoteServiceRelativePath("../GwtLectureNoteService")
public interface GwtLectureNoteService extends RemoteService {

    /**
     * Utility class for simplifying access to the instance of async service.
     */
    public static class Util {

        private static GwtLectureNoteServiceAsync instance;

        public static GwtLectureNoteServiceAsync getInstance() {
            if (instance == null) {
                instance = GWT.create(GwtLectureNoteService.class);
            }
            return instance;
        }
    }

    /**
     * Creates a lecture note.
     * 
     * @param lectureNote lecture note
     * @return lecture note
     */
    public LectureNoteDTO createLectureNote(LectureNoteDTO lectureNote);

    /**
     * Updates a lecture note.
     * 
     * @param lectureNote lecture note
     * @return lecture note
     */
    public LectureNoteDTO updateLectureNote(LectureNoteDTO lectureNote);

    /**
     * Deletes a lecture note.
     * 
     * @param lectureNote lecture note
     */
    public void deleteLectureNote(LectureNoteDTO lectureNote);

    /**
     * Returns list of lecture notes in a course.
     * 
     * @param course course
     * @return list of lecture notes
     */
    public List<LectureNoteDTO> getLectureNotes(CourseDTO course);
}
